package org.forever.view
{
	import mx.collections.ArrayList;
	import mx.graphics.SolidColor;
	import mx.logging.ILogger;
	import mx.logging.Log;
	
	import spark.components.BorderContainer;
	
	/**测试矩形类*/
	public class Task extends BorderContainer implements ICallBack
	{
		private static var _log:ILogger = Log.getLogger("org.forever.view.Task");
		public var _width:int=100;//宽度
		public var _height:int=50;//高度
		public var _color:uint=0xe5e5c2;//颜色
		public var _cornerRadius:int=0;//圆角大小
		private var _outEdges:ArrayList;//关联出边表：存放以当前顶点为尾的所有边（的位置）
		private var _inEdges:ArrayList;//关联入边表：存放以当前顶点为头的所有边（的位置）
		
		
		public function Task()
		{
			this.width=_width;
			this.height=_height;
			this.backgroundFill = new SolidColor(_color);
			this.setStyle("cornerRadius",_cornerRadius);
			_outEdges = new ArrayList();
			_inEdges = new ArrayList();
		}
		
		/**
		 * 当矩形改变位置后更新所有出边和入边的位置
		 * */
		public function call():void{
			for(var i:int=0;i<_outEdges.length;i++){
				(_outEdges.getItemAt(i) as BrokenLine).updateFirstRect();
			}
			
			for(var j:int=0;j<_inEdges.length;j++){
				(_inEdges.getItemAt(j) as BrokenLine).updateLastRect();
			}
		}

		public function get outEdges():ArrayList
		{
			return _outEdges;
		}

		public function set outEdges(value:ArrayList):void
		{
			_outEdges = value;
		}

		public function get inEdges():ArrayList
		{
			return _inEdges;
		}

		public function set inEdges(value:ArrayList):void
		{
			_inEdges = value;
		}


	}
}